gdk_gl_context_get_display
gdk_gl_context_get_window
gdk_gl_context_get_shared_context
+gdk_gl_context_get_version
+
+<SUBSECTION>
gdk_gl_context_set_required_version
gdk_gl_context_get_required_version
gdk_gl_context_set_debug_enabled
GdkGLProfile
gdk_gl_context_set_profile
gdk_gl_context_get_profile
+
+<SUBSECTION>
GdkGLError
gdk_gl_context_realize
gdk_gl_context_make_current
int major;
int minor;
+ int gl_version;
guint realized : 1;
guint use_texture_rectangle : 1;
if (priv->extensions_checked)
return;
+ priv->gl_version = epoxy_gl_version ();
+
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
g_warning ("GL implementation doesn't support any form of non-power-of-two textures");
GDK_NOTE (OPENGL,
- g_print ("Extensions checked:\n"
+ g_print ("OpenGL version: %d.%d\n"
+ "Extensions checked:\n"
" - GL_ARB_texture_non_power_of_two: %s\n"
" - GL_ARB_texture_rectangle: %s\n"
" - GL_EXT_framebuffer_blit: %s\n"
" - GL_GREMEDY_frame_terminator: %s\n"
"Using texture rectangle: %s\n",
+ priv->gl_version / 10, priv->gl_version % 10,
has_npot ? "yes" : "no",
has_texture_rectangle ? "yes" : "no",
priv->has_gl_framebuffer_blit ? "yes" : "no",
return priv->shared_context;
}
+/**
+ * gdk_gl_context_get_version:
+ * @context: a #GdkGLContext
+ * @major: (out): return location for the major version
+ * @minor: (out): return location for the minor version
+ *
+ * Retrieves the OpenGL version of the @context.
+ *
+ * The @context must be realized prior to calling this function.
+ *
+ * Since: 3.16
+ */
+void
+gdk_gl_context_get_version (GdkGLContext *context,
+ int *major,
+ int *minor)
+{
+ GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+
+ g_return_if_fail (GDK_IS_GL_CONTEXT (context));
+ g_return_if_fail (priv->realized);
+
+ if (major != NULL)
+ *major = priv->gl_version / 10;
+ if (minor != NULL)
+ *minor = priv->gl_version % 10;
+}
+
/**
* gdk_gl_context_clear_current:
*